package com.xzy.springboot.controller;

import com.xzy.springboot.service.PaymentService;
import jdk.nashorn.internal.ir.IfNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PaymentController {


    @Value("${server.port}")
    private String serverport;

    @Autowired
    private PaymentService paymentService;

    @GetMapping("/payment/getok/{id}")
    public String PaymentOk(@PathVariable("id") Integer id){
       return paymentService.PaymentOk(id)+serverport;
    }


    @GetMapping("/payment/getout/{id}")
    public String PaymentTimeout(@PathVariable("id") Integer id){

        return paymentService.PaymentTimeout(id)+serverport;
    }
    @GetMapping("/payment/fusing/{id}")
    public String Paymentfusing(@PathVariable("id") Integer id){

        return paymentService.paymentfusing(id);
    }

}
